package com.xbts.screen.config;

import com.xbts.common.core.enums.WorkshopTypeEnum;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

@Component
public class MyInitializer {

    @Value("${spring.datasource.dynamic.datasource.master.url}")
    private String dbcUrl;
    @Value("${spring.datasource.dynamic.datasource.master.username}")
    private String jdbcUser;
    @Value("${spring.datasource.dynamic.datasource.master.password}")
    private String jdbcPassword;

    @PostConstruct
    public void init() {
        WorkshopTypeEnum.initializeFromDatabase(dbcUrl, jdbcUser, jdbcPassword);
    }
}
